import createAxios from '/@/utils/axios'

export const enneagramBaseUrl = '/api/enneagram/'
export const orderUrl = '/api/order/'
export function index(params: object = {}) {
    return createAxios(
        {
            url: enneagramBaseUrl + 'index',
            data: params,
            method: 'get',
        },
        { showCodeMessage: false }
    )
}

export function start() {
    return createAxios(
        {
            url: enneagramBaseUrl + 'start',
            method: 'get',
        },
        { showCodeMessage: false }
    )
}
// loading: false, // 是否开启loading层效果, 默认为false
//         reductDataFormat: true, // 是否开启简洁的数据结构响应, 默认为true
//         showErrorMessage: true, // 是否开启接口错误信息展示,默认为true
//  showCodeMessage: true, // 是否开启code不为1时的信息提示, 默认为true
export function submit(params: anyObj) {
    return createAxios(
        {
            url: enneagramBaseUrl + 'submit',
            method: 'POST',
            data: params,
        },
        { showCodeMessage: false }
    )
}

export function calculate(params: anyObj) {
    return createAxios(
        {
            url: enneagramBaseUrl + 'calculate',
            method: 'POST',
            data: params,
        },
        { showCodeMessage: false }
    )
}

export function report(params: anyObj) {
    return createAxios({
        url: enneagramBaseUrl + 'report',
        method: 'get',
        params: params,
    })
}
export function poster(params: anyObj) {
    return createAxios({
        url: enneagramBaseUrl + 'poster',
        method: 'get',
        params: params,
    })
}
export function toPay(params: anyObj) {
    return createAxios({
        url: enneagramBaseUrl + 'toPay',
        method: 'get',
        params: params,
    })
}
// 订单相关--------------------------
export function createOrder(params: anyObj) {
    return createAxios({
        url: orderUrl + 'create',
        method: 'POST',
        data: params,
    })
}
export function payment(params: anyObj) {
    return createAxios({
        url: orderUrl + 'payment',
        method: 'POST',
        data: params,
    })
}
export function checkPayStatus(params: anyObj) {
    return createAxios({
        url: orderUrl + 'checkPayStatus',
        method: 'POST',
        data: params,
    })
}
